Skip to content

feat(cadence-matching): Add drain observer for SD executor client#7751

Merged
gazi-yestemirova merged 1 commit intocadence-workflow:masterfrom
gazi-yestemirova:matching_drain_observer
Feb 26, 2026
Merged

feat(cadence-matching): Add drain observer for SD executor client#7751
gazi-yestemirova merged 1 commit intocadence-workflow:masterfrom
gazi-yestemirova:matching_drain_observer

Conversation

@gazi-yestemirova
Copy link
Contributor

What changed?
This PR adds DrainObserver field to resource.Params to inject a DrainSignalObserver into the matching service at initialization.
We wire the drain observer through matching.Service -> handler.NewEngine -> setupExecutor -> executorclient.Params, enabling the executor client's heartbeat loop to react to infrastructure drain/undrain signals.

Why?
The shard-distributor executor client already supports drain-aware behavior via the DrainObserver field on executorclient.Params. However, there was no way to wire a DrainSignalObserver into the matching service's executor client because resource.Params didn't have it.
PR follows the same pattern used by ShardDistributorMatchingConfig initialization.

How did you test it?
Unit tests with go test -v ./service/matching/handler/

Potential risks
Since drainObserver field is optional there wouldn't be any changes in cadence-matching's behaviour.

Release notes
N/A

Documentation Changes
N/A


Reviewer Validation

PR Description Quality (check these before reviewing code):

  • "What changed" provides a clear 1-2 line summary
    • Project Issue is linked
  • "Why" explains the full motivation with sufficient context
  • Testing is documented:
    • Unit test commands are included (with exact go test invocation)
    • Integration test setup/commands included (if integration tests were run)
    • Canary testing details included (if canary was mentioned)
  • Potential risks section is thoughtfully filled out (or legitimately N/A)
  • Release notes included if this completes a user-facing feature
  • Documentation needs are addressed (or noted if uncertain)

Signed-off-by: Gaziza Yestemirova <gaziza@uber.com>
@gitar-bot
Copy link

gitar-bot bot commented Feb 26, 2026

Code Review ✅ Approved

Clean parameter threading for drain observer through the matching service initialization chain. Follows the established pattern, is nil-safe, and tests are updated appropriately.

Rules ❌ No requirements met

Repository Rules

PR Description Quality Standards: Add GitHub issue link and provide specific test command with -run flag for reproducibility

2 rules not applicable. Show all rules by commenting gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gazi-yestemirova gazi-yestemirova merged commit d44afb8 into cadence-workflow:master Feb 26, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants